﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xamarin.Forms;
using Xamarin.Forms.Xaml;

namespace JWXH.XH.components
{
    [XamlCompilation(XamlCompilationOptions.Compile)]
    public partial class NavigateBar : ContentView
    {
        public NavigateBar()
        {
            InitializeComponent();
            BindingContext = this;
        }


        private void Tap_ImgBack(object sender, EventArgs e)
        {
            Navigation.PopAsync();
        }

        // 后缀一定是 属性+Property  不要加其他任何东西
        public static readonly BindableProperty TitleProperty = BindableProperty.Create(
            "Title",
            typeof(string),
            typeof(NavigateBar),
            "this is title",
            BindingMode.TwoWay,
            propertyChanging: (BindableObject bindable, object oldValue, object newValue) =>
            {
                (bindable as NavigateBar).LbTitle.Text = newValue as string;
            }
        );

        public string Title
        {

            get { return (string)GetValue(TitleProperty); }
            set { SetValue(TitleProperty, value); }

        }
    }
}